package us.mooresr.geartrack.client.core.desktop;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class SingleItemForm extends Composite {
	@UiField TextBox nameBox;

	private static PeopleFormUiBinder uiBinder = GWT
			.create(PeopleFormUiBinder.class);

	interface PeopleFormUiBinder extends UiBinder<Widget, SingleItemForm> {
	}

	public SingleItemForm() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	public String getName() {
		return nameBox.getText();
	}
	
	public void setName(String name) {
		if (name == null) {
			nameBox.setValue("");
		} else {
			nameBox.setValue(name);
		}
	}
	
	public void clear() {
		nameBox.setValue("");
	}
}
